package com.js.rtu.fragment.second;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.js.rtu.R;
import com.js.rtu.base.BaseFragment;
import com.js.rtu.event.StartBrotherEvent;

import org.greenrobot.eventbus.EventBus;

import androidx.appcompat.widget.Toolbar;
import butterknife.BindView;
import butterknife.OnClick;


/**
 * 23设置终端地址、中心站地址
 * Created by zwz on 2020/6/22.
 */
public class Cmd_23_AccessFragment extends BaseFragment {


    @BindView(R.id.toolbar)
    Toolbar toolbar;
    @BindView(R.id.toolbar_title)
    TextView toolbarTitle;


    public static Cmd_23_AccessFragment newInstance() {
        Cmd_23_AccessFragment fragment = new Cmd_23_AccessFragment();
        Bundle bundle = new Bundle();
        fragment.setArguments(bundle);
        return fragment;
    }


    @Override
    protected int getLayoutId() {
        return R.layout.fragment_tab_second_cmd_23_access;
    }

    @Override
    protected void initView() {
        toolbarTitle.setText("设置终端地址、中心站地址");
        initToolbarNav(toolbar);
    }

    @OnClick({R.id.ll_10, R.id.ll_11, R.id.ll_12, R.id.ll_13, R.id.ll_14, R.id.ll_15, R.id.ll_16, R.id.ll_17, R.id.ll_19})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.ll_10:
                EventBus.getDefault().post(new StartBrotherEvent(Cmd_23_10Fragment.newInstance()));
                break;
            case R.id.ll_11:
                EventBus.getDefault().post(new StartBrotherEvent(Cmd_23_11Fragment.newInstance()));
                break;
            case R.id.ll_12:
                EventBus.getDefault().post(new StartBrotherEvent(Cmd_23_12Fragment.newInstance()));
                break;
            case R.id.ll_13:
                EventBus.getDefault().post(new StartBrotherEvent(Cmd_23_13Fragment.newInstance()));
                break;
            case R.id.ll_14:
                EventBus.getDefault().post(new StartBrotherEvent(Cmd_23_14Fragment.newInstance()));
                break;
            case R.id.ll_15:
                EventBus.getDefault().post(new StartBrotherEvent(Cmd_23_15Fragment.newInstance()));
                break;
            case R.id.ll_16:
                EventBus.getDefault().post(new StartBrotherEvent(Cmd_23_16Fragment.newInstance()));
                break;
            case R.id.ll_17:
                EventBus.getDefault().post(new StartBrotherEvent(Cmd_23_17Fragment.newInstance()));
                break;
            case R.id.ll_19:
                EventBus.getDefault().post(new StartBrotherEvent(Cmd_23_19Fragment.newInstance()));
                break;
        }
    }



}
